<template>
  <div class="here">
    <h3>登录</h3>
    <el-button @click="addtoken()">add token</el-button>
    <el-row>{{ loginInfo.username }}</el-row>
    <el-row>{{ loginInfo.userid }}</el-row>
    <el-row>{{ loginInfo.token }}</el-row>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "Login",
  methods: {
    addtoken() {
      this.$store.commit("change", {
        key: "loginInfo",
        val: {
          username: "wsz",
          userid: "9999",
          token: "nvjlksdafhisewe8f9whue23h231e3nf3"
        }
      });
    }
  },
  computed: mapState(["loginInfo"])
};
</script>
